//
// Created by xili on 2024/8/30 20:39.
// GO BIG OR GO HOME.
//
#include "leetcode.h"

class Solution {
public:
    int minProcessingTime(vector<int> &processorTime, vector<int> &tasks) {
        sort(processorTime.begin(), processorTime.end());
        sort(tasks.begin(), tasks.end(), greater());
        int n = processorTime.size();
        int ans = 0;
        for (int i = 0; i < n; i++) {
            ans = max(ans, processorTime[i] + tasks[i * 4]);
        }
        return ans;
    }
};